package thinkingJava.chapter15;

import thinkingJava.chapter14.Dog;

class PerformingDog extends Dog implements Performs {
	public void speak() {
		System.out.println("woof!");
	}
	public void sit() {
		System.out.println("sitting...");
	}
	public void reproduce() {}
}
class Robot implements Performs {
	public void speak() {
		System.out.println("Click");
	}
	public void sit() {
		System.out.println("Clank");
	}
	public void oilChange() {}
}
class Comunicate {
	public static <T extends Performs> void perform(T performer) {
		performer.speak();
		performer.sit();
	}
}
public class DogsAndRobots {
	public static void main(String[] args) {
		PerformingDog d = new PerformingDog();
		Robot r = new Robot();
		Comunicate.perform(d);
		Comunicate.perform(r);
	}
}
